package com.sc.VenusQueryBeta.adapter.home;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sc.VenusQueryBeta.R;
import com.sc.VenusQueryBeta.adapter.BaseCompatAdapter;
import com.sc.VenusQueryBeta.api.Host;
import com.sc.VenusQueryBeta.global.MyApplication;
import com.sc.VenusQueryBeta.model.bean.home.ActivityListBean;

import java.util.List;

/**
 * Created by Administrator on 2018/10/10.
 * 活动列表适配器
 */

public class ActivityListAdapter extends BaseCompatAdapter<ActivityListBean.DataBean,BaseViewHolder> {

    public ActivityListAdapter(int layoutResId, @Nullable List<ActivityListBean.DataBean> data) {
        super(layoutResId, data);
    }

    public ActivityListAdapter(int item_tjzx) {
        super(item_tjzx);
    }

    @Override
    protected void convert(BaseViewHolder helper, ActivityListBean.DataBean item) {

        ImageView iv = helper.getView(R.id.iv);
        Glide.with(MyApplication.app).load(Host.HostImg+item.getImageUrl()).diskCacheStrategy(DiskCacheStrategy.SOURCE).centerCrop().dontAnimate()
                .into(iv);

    }



}